package com.gopay.common.domain.riskcontrol;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;

import javax.persistence.*;
import java.util.Date;

/**
 * 银行卡灰名单
 * Created by liuyu on 2016/11/29.
 */
@Entity
@Table(name = "RC_BANK_CARD_GRAYLIST")
public class RcBankCardGraylist extends BaseEntity {
    private static final long serialVersionUID = 1L;

    private String id;// ID
    private String cardNo;// 银行卡号
    private String preMoveType;// 预处理类型 1-自动 2-手动
    private String createdOperId;// 创建人ID
    private Date createdTs;// 创建时间
    private String status;// 移除状态1-正常2-移除
    private String lastUpdOperId;// 移除用户ID
    private Date lastUpdTs;// 移除时间
    private String moveType;// 处理类型 1-自动 2-手动
    private String reason;// 处理原因
    private String remark;// 备注
    private int version;
    private String source;//名单来源

    @Id
    @Column(name = "ID")
    public String getId() {
        return id;
    }

    @Column(name = "CARD_NO", length = 150)
    public String getCardNo() {
        /**描述：pci改造   update by:jianghoupeng   2017/2/28 10:55  start*/
        this.cardNo = SensitiveInfoUtils.autoReencrypt(this.cardNo);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.cardNo);
        /**描述：pci改造   update by:jianghoupeng   2017/2/28 10:55  end*/
    }

    @Column(name = "PRE_MOVE_TYPE", length = 1)
    public String getPreMoveType() {
        return preMoveType;
    }

    @Column(name = "CREATED_OPER_ID", length = 10)
    public String getCreatedOperId() {
        return createdOperId;
    }

    @Column(name = "CREATED_TS")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCreatedTs() {
        return createdTs;
    }

    @Column(name = "STATUS", length = 2)
    public String getStatus() {
        return status;
    }

    @Column(name = "LAST_UPD_OPER_ID", length = 10)
    public String getLastUpdOperId() {
        return lastUpdOperId;
    }

    @Column(name = "LAST_UPD_TS")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastUpdTs() {
        return lastUpdTs;
    }

    @Column(name = "MOVE_TYPE", length = 1)
    public String getMoveType() {
        return moveType;
    }

    @Column(name = "REASON", length = 100)
    public String getReason() {
        return reason;
    }

    @Column(name = "REMARK", length = 100)
    public String getRemark() {
        return remark;
    }

    @Version
    @Column(name = "VERSION", precision = 22, scale = 0)
    public int getVersion() {
        return version;
    }

    @Column(name = "SOURCE", length = 20)
    public String getSource() {
        return this.source;
    }
    
    public void setId(String id) {
        this.id = id;
    }

    public void setCardNo(String cardNo) {
        /**描述：   update by:jianghoupeng   2017/2/28 10:57  start*/
        this.cardNo = SensitiveInfoUtils.smartEncryptWithCheck(cardNo);
        /**描述：   update by:jianghoupeng   2017/2/28 10:57  end*/
    }

    public void setPreMoveType(String preMoveType) {
        this.preMoveType = preMoveType;
    }

    public void setCreatedOperId(String createdOperId) {
        this.createdOperId = createdOperId;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public void setLastUpdOperId(String lastUpdOperId) {
        this.lastUpdOperId = lastUpdOperId;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }

    public void setMoveType(String moveType) {
        this.moveType = moveType;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public void setVersion(int version) {
        this.version = version;
    }
    
    public void setSource(String source) {
        this.source = source;
    }

}
